package com.rran.study.designpattern.structural.proxy;

import org.springframework.cglib.proxy.Enhancer;

import java.lang.reflect.Proxy;

/**
 * @author yy
 * @Type CglibProxyClient.java
 * @Desc
 * */
public class CglibProxyClient {

    public static void main(String[] args) {
        CglibDynamicProxy cglibDynamicProxy = new CglibDynamicProxy();
        Enhancer enhancer = new Enhancer();
        enhancer.setSuperclass(RealSubject.class);
        enhancer.setCallback(cglibDynamicProxy);
        RealSubject proxy = (RealSubject) enhancer.create();
        proxy.request();
    }
}